<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">

<h:head>
	<title>祖龙娱乐  - BI系统</title>
	<link href="../../css/component.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="../../js/highcharts.js"></script>
	<script type="text/javascript" src="../../js/drawChart.js"></script>
</h:head>

<h:body>
	<ui:param name="bean" value="#{rechargeFlowAction2}" />
	
	<span class="pagetitle">流水查询 —— 实时充值流水</span>
	<p:separator />
	
	<!-- 右侧页面顶部查询部分 -->
	<h:form id="fsearch">
		<p:growl id="growl" showDetail="true" sticky="true" />
		
		<p:dataTable id="dlist0" value="#{bean}" scrollable="true" resizableColumns="true" paginator="false" style="text-align:center;">
			<p:column headerText="开始日期" styleClass="column" style="width:170px">
				<p:calendar value="#{bean.dateStart}" mode="popup" pattern="yyyy-MM-dd" />
			</p:column>
			<p:column headerText="结束日期" styleClass="column" style="width:170px">
				<p:calendar value="#{bean.dateEnd}" mode="popup" pattern="yyyy-MM-dd" />
			</p:column>
			<p:column headerText="平台" styleClass="column" style="width:80px">
				<p:selectOneMenu id="platformSel" styleClass="queryPlatform" value="#{bean.queryPlatform}">
			        <f:selectItems value="#{bean.platformItmes}" />
			        <p:ajax update="channelSel serverSel" listener="#{bean.selectPlatformItems}" />
		        </p:selectOneMenu>
			</p:column>
			<p:column headerText="渠道" styleClass="column" style="width:120px">
				<p:selectOneMenu id="channelSel" styleClass="queryChannel" value="#{bean.queryChannel}">
			        <f:selectItems value="#{bean.channelItmes}" />
			        <p:ajax update="serverSel platformSel" listener="#{bean.selectChannelItems}" />
		        </p:selectOneMenu>
			</p:column>
			<p:column headerText="区服" styleClass="column" style="width:120px">
				<p:selectOneMenu id="serverSel" styleClass="queryServer" value="#{bean.queryServer}">
			         <f:selectItems value="#{bean.serverItmes}" />
			         <p:ajax update="channelSel platformSel" listener="#{bean.selectServerItems}" />
		        </p:selectOneMenu>
			</p:column>
			<p:column headerText="内部订单号" styleClass="column" style="width:90px">
				<h:inputText value="#{bean.queryBean.orderid2}"   style="width:94%"/>
			</p:column>
			<p:column headerText="外部订单号" styleClass="column" style="width:90px">
				<h:inputText value="#{bean.queryBean.orderid}"   style="width:94%"/>
			</p:column>
			<p:column headerText="帐号ID" styleClass="column" style="width:120px">
				<h:inputText value="#{bean.queryBean.userid}"  style="width:94%"/>
			</p:column>
			<p:column headerText="角色ID" styleClass="column" style="width:60px">
				<h:inputText value="#{bean.queryBean.roleid}"  style="width:94%" />
			</p:column>
			<p:column headerText="是否首充" styleClass="column" style="width:70px">
				<p:selectOneMenu value="#{bean.queryBean.flag}">
					 <f:selectItem itemLabel="全部" itemValue="-1" />
			         <f:selectItem itemLabel="是" itemValue="1" />
			         <f:selectItem itemLabel="否" itemValue="0" />
		        </p:selectOneMenu>
			</p:column>
			<p:column headerText="支付方式" style="width:100px">
				<p:selectOneMenu value="#{bean.queryBean.addtype}">
			         <f:selectItems value="#{bean.addtypeItmes}" />
		        </p:selectOneMenu>
			</p:column>
            <p:column headerText="商品名称" style="width:100px">
                <p:selectOneMenu value="#{bean.queryBean.product}">
                    <f:selectItems value="#{bean.productItmes}" />
                </p:selectOneMenu>
            </p:column>
			
			<p:column headerText="操作" style="width:50px">
				<p:commandButton value="查询" action="#{bean.search()}" update=":data" ajax="false" />
			</p:column>
        </p:dataTable>
	</h:form>
	<br />
	<!-- 数据展示部分，包含表格和图表 -->
	<h:form id="dform">
		<div class="data" id="data">
			<p:panel id="panel1" header="查询结果" style="margin-bottom:10px;">
                <h:commandLink rendered="#{bean.result != null and bean.result.size() > 0}">
                    <p:graphicImage url="/resources/images/excel.png" height="25px" />
                    <p:dataExporter type="xls" target="dlist1" fileName="rechargeFlow-#{pageHelper.getNewDateDetailStr()}" />
                </h:commandLink>
                <p:dataTable id="dlist1" var="l" value="#{bean.result}" scrollable="true" resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
					<p:column headerText="内部订单号" styleClass="column" style="width:100px">
						<h:outputLabel value="#{l.innerorderid}" style="width:100%" />
					</p:column>
					<p:column headerText="外部订单号" styleClass="column" style="width:100px">
						<h:outputLabel value="#{l.outerorderid}" style="width:100%" />
					</p:column>
					<p:column headerText="详细时间" styleClass="column" style="width:140px">
						<h:outputLabel value="#{l.logtime}" style="width:100%" />
					</p:column>
					<p:column headerText="平台" styleClass="column" style="width:60px">
						<h:outputLabel value="#{pageHelper.getPlatformNameById(l.platform.toString())}"  style="width:100%"/>
					</p:column>
					<p:column headerText="渠道" styleClass="column" style="width:60px">
						<h:outputLabel value="#{pageHelper.getChannelNameById(l.channelid.toString())}"  style="width:100%"/>
					</p:column>
					<p:column headerText="区服" styleClass="column" style="width:80px">
						<h:outputLabel value="#{pageHelper.getServerNameById(l.serverid.toString())}"  style="width:100%"/>
					</p:column>
					<p:column headerText="设备mac地址" styleClass="column" style="width:260px">
						<h:outputLabel value="#{l.mac}"  style="width:100%"/>
					</p:column>
					<p:column headerText="账号ID" styleClass="column" style="width:120px">
						<h:outputLabel value="#{l.userid}"  style="width:100%"/>
					</p:column>
					<p:column headerText="角色ID" styleClass="column" style="width:60px">
						<h:outputLabel value="#{l.roleid}"  style="width:100%"/>
					</p:column>
					<p:column headerText="角色等级" styleClass="column" style="width:50px">
						<h:outputLabel value="#{l.rolelevel}"  style="width:100%"/>
					</p:column>
					<p:column headerText="VIP等级" styleClass="column" style="width:50px">
						<h:outputLabel value="#{l.viplevel}"  style="width:100%"/>
					</p:column>
					<p:column headerText="充值总金额" styleClass="column" style="width:100px">
						<h:outputLabel value="#{bean.getMoeny(l.totalcash)}"  style="width:100%"/>
					</p:column>
					<p:column headerText="充值金额#{pageHelper.getMoneyType()}" styleClass="column" style="width:70px">
						<h:outputLabel value="#{bean.getMoeny(l.cashadd)}"  style="width:100%"/>
					</p:column>
					<p:column headerText="本次增加元宝" styleClass="column" style="width:90px">
						<h:outputLabel value="#{l.yuanbaoadd}"  style="width:100%"/>
					</p:column>
					<p:column headerText="是否首次付费" styleClass="column" style="width:80px">
						<h:outputLabel value="#{l.flag.toString() == '1' ? '是' : '否'}(#{l.flag})"  style="width:100%"/>
					</p:column>
					<p:column headerText="充值类型" styleClass="column" style="width:80px">
						<h:outputLabel value="#{bean.getAddType(l.addtype)}(#{l.addtype})"  style="width:100%"/>
					</p:column>
                    <p:column headerText="商品名称" styleClass="column" style="width:80px">
                        <h:outputLabel value="#{bean.getProductName(l.productid)}(#{l.productid})"  style="width:100%"/>
                    </p:column>
				</p:dataTable>
			</p:panel>
		</div>
	</h:form>
	<!-- 页脚 -->
	<div class="footer"></div>
</h:body>
</html>